<?php
    //set up database variables
	$dbusername = "joshhughes22";
	$dbpass = "addisyn";
	$dbhost = "localhost";
	$database = "joshhughes_com_-_hockey";
	//Connect To The Database
	mysql_connect($dbhost,$dbusername,$dbpass) or die("Cannot connect to the hockey database for QP processing.<br/>");
	//Open Database
	mysql_select_db($database) or die("Cannot select the database for QP processing.<br/>");
	
	//UserID
	$userID = $func;
	//League
	$League = $L;
	
	$SQL = "UPDATE ".$League."QuickPicks SET ";
	$ranking = 1;
	foreach ($team_list as $TeamName)
	{
		$SQL.= "Team".$ranking."='".$TeamName."', ";
        $ranking++;
	}
	$SQL = substr($SQL, 0, strlen($SQL)-2);	//Remove the comma & space from last field to be updated.
	$SQL.= " WHERE UserID=$userID";
	echo $SQL;
	//Process Query
	mysql_query($SQL) or die("Cannot query the database.<br/>");

?>